import { request } from '../utils/index.js';
    export default {
    getMov: ({ curPage = 1, eachPage = 10 } = {}) => request({
        type: "get",
        url: "/api/movies",
        data: { curPage, eachPage }
    }),
    updateMovies: ({ _id } = {}) => request({
        type: "post",
        url: "/api/movies/updateMovies",
        data: { _id }
    }),
    updateMoviesSave: data => request({
        type: "patch",
        url: "/api/movies/updateMoviesSave",
        data: data
    }),
    delMovies: ({ _id } = {}) => request({
        type: "delete",
        url: "/api/movies/delMovies",
        data: { _id }
    }),

    addMovies: data => request({
        type: "post",
        url: "/api/movies/addMovies",
        data: data
    }),
    // 查询
    searchMovies: (data) => request({
        type: "post",
        url: "/api/movies/searchMovies",
        data: (data)
    }),
    getOne: _id => request({
        type: "get",
        url: `/api/movies/${_id}`,
    }),
    //删除图片
    deleteImgs: ({ _id,url },types) => request({
        type: "delete",
        url: `/api/movies/${_id}/imgs/${encodeURIComponent(url)}/${types} `,
    }),
}